gtk-demo/dnd: Fix up drag_cancel
authorAlexander Larsson <alexl@redhat.com>
Thu, 14 May 2020 08:45:38 +0000 (10:45 +0200)
committerAlexander Larsson <alexl@redhat.com>
Thu, 14 May 2020 08:45:38 +0000 (10:45 +0200)
This needs to return a boolean, also it should not call end because
that will be called anyway by Gtk+ after cancel, and this was causing
warnings due to the opacity being unset with no dragged widget set.

demos/gtk-demo/dnd.c

index 764527a1ba752eee402de9a9ada98e99bba614e9..5510e61c6a0430b48166e88a88a46ccb55142683 100644 (file)
@@ -53,12 +53,12 @@ drag_end (GtkDragSource *source,
   gtk_widget_set_opacity (item, 1.0);
 }
 
-static void
+static gboolean
 drag_cancel (GtkDragSource       *source,
              GdkDrag             *drag,
              GdkDragCancelReason  reason)
 {
-  drag_end (source, drag);
+  return FALSE;
 }
 
 typedef struct {